﻿#pragma once


#include <osgQOpenGL/osgQOpenGLWidget>
#include <osgDB/ReadFile>
#include <osgUtil/Optimizer>
#include <osg/CoordinateSystemNode>
#include <osg/Switch>
#include <osg/Types>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgGA/KeySwitchMatrixManipulator>
#include <osgGA/StateSetManipulator>
#include <osgGA/AnimationPathManipulator>
#include <osgGA/TerrainManipulator>
#include <osgGA/SphericalManipulator>
#include <osgGA/Device>


#include <QApplication>
#include <QSurfaceFormat>

#include <osg/Geometry>
#include <osg/Geode>
#include <osgViewer/Viewer>



#define OSGQT_INIT_CODE \
    QSurfaceFormat format = QSurfaceFormat::defaultFormat(); \
    format.setVersion(2, 0); \
    format.setProfile(QSurfaceFormat::CompatibilityProfile); \
    format.setRenderableType(QSurfaceFormat::OpenGL); \
    format.setOption(QSurfaceFormat::DebugContext); \
    format.setDepthBufferSize(24); \
    format.setSamples(8); \
    format.setStencilBufferSize(8); \
    format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); \
    QSurfaceFormat::setDefaultFormat(format); \
    QApplication app(argc, argv); \
    osg::ArgumentParser arguments(&argc, argv); \
    osgQOpenGLWidget widget(&arguments);


